<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Notebar - Sketch MeaXure</title>

    <link href="assets/css/normalize.css" rel="stylesheet">
    <link href="assets/css/app.css" rel="stylesheet">
    <script type="text/javascript" src="assets/js/jquery-2.2.4.min.js"></script>
    <script type="text/javascript" src="assets/js/common.js"></script>
    <style>
        #note-box {
            background-color: #3d3d3d;
            padding: 8px;
            margin: 0;
            color: #DDD;
            width: 204px;
            height: 104px;
            overflow-x: hidden;
            overflow-y: overlay;
            border: none !important;
            box-shadow: none !important;
            outline: none !important;
        }
    </style>
</head>

<body>
    <textarea id="note-box" placeholder="请输入备注信息" oninput="onTextChange()"></textarea>
    <script>
        function onTextChange() {
            if (window.meaxure) {
                meaxure.postMessage('change', $('#note-box').val());
            }
        }
        meaxure.onDidReceiveMessage('set-note', txt => {
            $('#note-box').val(txt);
        });
    </script>
</body>

</html>